/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package context;


import general.ApplicationManager;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 *
 * @author isaias
 *
 * 
 */
public class ContextListener implements ServletContextListener{
      public void contextInitialized(ServletContextEvent sce) {
        System.out.println(">>>>>>>>>>>>>>>>> CONTEXT INITIALIZED... OBRAPROJECT <<<<<<<<<<<<<<<<");
        ApplicationManager.init();

        new Thread() {

            @Override
            public void run() {
                try {
                    sleep(20000);
                    // Para envio de mensagens
              //      ScheduleManager.start();
                } catch (InterruptedException ex) {
                    Logger.getLogger(ContextListener.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }.start();
 
    }

    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println(">>>>>>>>>>>>>>>>>  CONTEXT DESTROYED... OBRAPROJECT <<<<<<<<<<<<<<<<");
    }
}
